package designpattern.factory.easy;
//简单工厂模式
public class EasyFactory {
    public static HuMan creatHuman(Class clazz){
        if (Black.class == clazz ){
            return new Black();
        }else if (clazz== Yellow.class){
            return new Yellow();
        }else {
            return new White();
        }
    }

    public static void main(String[] args) {
        creatHuman(Black.class).printColor();
        creatHuman(White.class).printColor();
        creatHuman(Yellow.class).printColor();
    }
}
